import { GlobalFunction } from "../base/GlobalFunction";

const {ccclass, property} = cc._decorator;

@ccclass
export default class modelBase extends cc.Component {
    setDirection(dirDegree){
        this.setRotation(0, dirDegree, 0);
    }

    setRotation(x,y,z){
        var _quat1 = new cc.Quat();
        var _quat2 = new cc.Quat();
        _quat1.fromEuler(new cc.Vec3(0, 0, 135));
        _quat2.fromEuler(new cc.Vec3(x, y, z));
        this.node.setRotation(GlobalFunction.quatMul(_quat1, _quat2));
    }
}
